$(function () {
    getNewsData("frontNews");
});

//调用后台接口
function getNewsData(url) {
    $.ajax({
        url: URL + url,//调用后台的地址
        // data: {username: username, password: password},//传递到后台的数据
        type: 'get',//方法类型 get,post
        dataType: 'json',//返回参数的类型，json，application/json,text
        success: function (data) {
            //   data即为后端传递过来的值
            getNewsJson(data);
        }
    })

}

function getNewsJson(data) {
    var company = data[0].companyModel;
    setCompany(company);
    var navList = data[0].navModelList;
    setNav(navList);


    var newsList = data[0].newsModelList;
    // setNews(newsList);


}

function setNews() {

}
